1. Field of the Invention
The invention relates to Serial Attached SCSI (SAS) communications and in particular relates to methods and systems providing simplified error recovery in response to detecting an error in a received frame in a SAS device.
2. Discussion of Related Art
Many present-day high performance storage systems utilize the SAS family of protocols to provide high performance and high reliability for a wide range of storage system applications. SAS provides the performance and flexibility of the long standardized SCSI command set while providing simplified communication coupling through the use of high speed serial communication media and protocols rather than wide parallel bus structures.
Among the suite of protocols within the SAS specification is the Serial SCSI Protocol (SSP). In general in SSP, SCSI commands and data are transmitted as frames on a SAS connection using the SSP protocol. In general, in accordance with the SCSI protocols and in particular in accordance with the SSP protocols, a number of command and/or data transmissions may be sent from an initiator device to a target device before an acknowledgment of successful processing is received (an ACK). Although each such a frame is eventually acknowledged, a plurality of such frames may be forwarded from the initiator to the target before the initiator pauses to await receipt of an appropriate acknowledgement for each successfully processed frame. The acknowledgement indicates correct receipt of a corresponding transmitted frame and completion of appropriate processing therefore. If an error occurs in a particular frame transmission, a negative acknowledgement (NAK) will be received by the initiator from the target device. Appropriate error recovery techniques may be employed as between the initiator and target devices to cause retransmission of any frames that were NAKed by the target device. The SCSI, SAS, and SSP standards as well as other related standards are well known to those of ordinary skill in the art and are well documented publicly at www.t10.org if the reader requires any background material.
Recovery from an erroneous transmission within the target device can be particularly complex. For example, according to the SAS and SSP protocol specifications, any frame that is ACKed must be correctly processed by the target device even if an earlier frame transmission was NAKed. Thus numerous complex boundary conditions and sequences need to be handled in a target device when a frame is NAKed but subsequently transmitted frames may have been correctly received and subsequently processed and ACKed.
Further complexities arise in particular SAS target device designs where a separate command buffer and data buffer are provided. Routing logic within such a SAS/SSP target device may determine whether a received frame is a command frame or a data frame based on, for example, a first received byte or word of a received frame. Thus the first received byte or word of a transmitted frame, if properly received, indicates whether the entire frame should be stored in the command buffer for further processing or in the data buffer for further processing. However, if the frame is received with an error, it is possible that the first byte or word thereof may be erroneous and thus the erroneous frame may be incorrectly stored in an improper buffer (i.e., erroneously mischaracterized as a data frame or a command frame based on an erroneous first byte or word). A Cyclic Redundancy Check (CRC) error is typical of an exemplary error condition in receipt of a frame. If a frame is received with a CRC error, the logic of the SAS device may improperly characterize the frame as data or command. Numerous other error conditions may arise in a SAS or SSP transmission all of which may encounter different boundary conditions and error recovery complexities within a SAS target device.
It is thus an ongoing challenge in the design of SAS/SSP devices to correctly process all received frames even in the presence of an erroneous frame in the midst of correctly received frames.